package com.baimuzhi.live.controller;

import com.baimuzhi.common.entity.JsonResoult;
import com.baimuzhi.live.entity.Live;
import com.baimuzhi.live.service.LiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.UnsupportedEncodingException;

/**
 * @ClassName : LiveController
 * @Description :
 * @Author : 肖叶茂
 * @Date: 2023/1/18  16:36
 */
@RestController
@RequestMapping("live")
public class LiveController {

    @Autowired
    private LiveService liveService;


    @RequestMapping("create")
    public Live create(Live live,String serverId) throws UnsupportedEncodingException {
        if(serverId == null){
            serverId = "live";
        }
        live = liveService.createLive(live,serverId);
        return live.Build();
    }
}
